package com.shortchainsystem.user.controller;
import com.shortchainsystem.link.ILinkClient;
import com.shortchainsystem.model.base.Result;
import com.shortchainsystem.model.domain.link.DO.UserDO;
import com.shortchainsystem.model.domain.user.User;
import com.shortchainsystem.model.exception.CustomCodeEnum;
import com.shortchainsystem.user.service.UserService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/register")
    @ApiOperation("用户注册")
    public Result register(@RequestBody UserDO userDO) {
        return userService.register(userDO);
    }

    @PutMapping("/edit")
    @ApiOperation("用户编辑修改")
    public Result edit(@RequestBody UserDO userDO) {
        return userService.edit(userDO);
    }
}